import java.util.Stack;

public class Main {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        System.out.println(stack.empty());//检查栈是否为空
        stack.push(5);//入栈
        stack.push(4);
        stack.push(3);
        stack.push(2);
        stack.push(1);
        System.out.println(stack.size());//获取栈的元素个数
        System.out.println(stack);
        System.out.println(stack.empty());
        System.out.println(stack.pop());//栈顶元素出栈
        System.out.println(stack.peek());//获取栈顶元素
    }
}